Skip to content

Conversation

@ana-pantilie
Copy link
Contributor

Part of #1278


Reviewer checklist
  • Test coverage: stack test --coverage
  • Public API documentation: stack haddock

@ana-pantilie ana-pantilie changed the title Change the representation of reachability claims Change the representation of reachability claims, part 1 Jul 28, 2020
@ana-pantilie ana-pantilie marked this pull request as ready for review July 28, 2020 16:08
@ana-pantilie ana-pantilie requested a review from ttuegel July 28, 2020 16:09
Copy link
Contributor

@ttuegel ttuegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approved, but with some questions and comments. I already pushed some clean-up commits.


instance
InternalVariable variable
=> From (Map (SomeVariable variable) (TermLike variable)) (Conditional variable ())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not From (Substitution variable) (Conditional variable ())? Or at least, there should be a direct instance.

where
from =
from @(Predicate variable) @(Conditional variable ())
. from @(Substitution variable) @(Predicate variable)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we put the Substitution into the substitution field? This would unpack the substitution into the predicate, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this isn't right. Thanks for spotting this!

-> Binder (SetVariable variable) (TermLike variable)
refreshSetBinder = refreshBinder refreshSetVariable

type Modality = Sort -> Alias (TermLike VariableName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to make this a sum type and do the conversion to Alias entirely in applyModality.

claimPattern left rightTerm =
ClaimPattern
{ left
, right = OrPattern.parseFromTermLike rightTerm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like converting between TermLike and OrPattern. This will go away once the series of pull requests is merged, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave this a little more thought, and maybe we won't actually need to parse the RHS in any other places except when actually parsing the definition. I'll remove it now.

instance Diff AllPathRule

instance Unparse AllPathRule where
unparse claimPattern' =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be a good idea to unparse through SentenceClaim.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually found this very strange when copying the instance from RulePattern. I thought claims should unparse to their pattern form. Adding the claim {} declaration at the beginning would make this a sentence.


import Prelude.Kore


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


newtype Pair variable = Pair (TermLike variable, Predicate variable)

class RuleBase base rule where
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this class very useful, now that we can have whole Patterns on the left- and right-hand sides?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests in Simplify should work on RewriteRules as well. I might remove this class once I clean up all the old code, but right now it seemed the cleanest way to run the tests with old/new claims and rewrite rules.

@rv-jenkins rv-jenkins merged commit d989053 into runtimeverification:master Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants